<?php
namespace app\validate;

use think\Validate;

class UserValidate extends Validate
{

    protected $rule = [
        'nickname'     => 'require',
        'name'         => 'require',
        'phone'        => 'require|mobile',
    ];
    
    protected $message           = [
        'nickname.require' => '请输入昵称',
        'name.require'     => '请输入真实姓名',
        'phone.require'    => '请输入手机号码',
        'phone.mobile'     => '手机号码格式不正确',
    ];
    
    protected $scene = [
        # 更新个人资料
        'update' => ['nickname'],

        # 身份认证
        'auth' => ['name', 'phone'],
    ];
}